package reportDetail

import (
	"gorm.io/plugin/soft_delete"
	"xkginweb/global"
)

// 上报详情表

type QccReportDetail struct {
	ReportDetailId  uint                  `gorm:"primary_key;AUTO_INCREMENT;comment:主键ID" json:"report_detail_id"`
	CreatedAt       global.LocalTime      `gorm:"type:datetime;comment:创建时间" json:"created_at"`
	UpdatedAt       global.LocalTime      `gorm:"type:datetime;comment:更新时间" json:"updated_at"`
	IsDeleted       soft_delete.DeletedAt `gorm:"type:bigint(20) unsigned;default:0;comment:是否删除" json:"is_deleted"`
	ReportId        uint                  `gorm:"type:bigint(20);comment:巡检记录id;NOT NULL" json:"report_id"`
	ItemType        string                `gorm:"type:varchar(50);comment:巡检项类型 cooling_pool  important_device  important_port  basis ;NOT NULL" json:"item_type"`
	ItemId          uint                  `gorm:"type:bigint(20);comment:巡检项ID;NOT NULL" json:"item_id"`
	ItemName        string                `gorm:"type:varchar(120);comment:巡检项名称;NOT NULL" json:"item_name"`
	ItemStatus      int                   `gorm:"type:int(11);comment:巡检项状态 1正常 2异常 3故障 4其他" json:"item_status"`
	ItemImages      string                `gorm:"type:text;comment:巡检项图片" json:"item_images"`
	ItemRemark      string                `gorm:"type:varchar(255);comment:巡检项备注" json:"item_remark"`
	ItemTemperature string                `gorm:"type:varchar(50);comment:巡检项温度" json:"item_temperature"`
	ItemHumidity    string                `gorm:"type:varchar(50);comment:巡检项湿度" json:"item_humidity"`
	ReporterId      uint                  `gorm:"type:bigint(20);comment:上报人id;default:0;NOT NULL" json:"reporter_id"`
	Reporter        string                `gorm:"type:varchar(50);comment:上报人;default:'';NOT NULL" json:"reporter"`
	PhoneNumber     string                `gorm:"type:varchar(20);default:'';comment:手机号（同账号）;NOT NULL" json:"phone_number"`
}

func (QccReportDetail) TableName() string {
	return "qcc_report_detail"
}
